package com.aivin.popuwindowdemo.bean;

import android.content.Context;
import android.graphics.Rect;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

public class MarginDecoration extends RecyclerView.ItemDecoration {

    private int margin;
    public MarginDecoration(Context context)   {
        margin = 10 ;
    }

    @Override
    public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
                               @NonNull RecyclerView parent, @NonNull RecyclerView.State state)  {
        super.getItemOffsets(outRect, view, parent, state);
        outRect.set(0, margin, margin, 0);
    }
}
